package com.shenmazong.serverwebpoem.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author 田不平
 * @project server-web-poem
 * @date 2020/3/16 8:53 PM
 * http://www.shenmazong.com
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "tb_poetry")
@Document(indexName = "tb_poetry",type = "_doc", shards = 1, replicas = 0)
public class TbPoetry {

    @TableId(value = "id", type = IdType.AUTO)
    @Id
    private Integer id;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String title;

    @Field(type = FieldType.Integer)
    private Integer dyid;

    @Field(type = FieldType.Keyword)
    private String dynasty;

    @Field(type = FieldType.Integer)
    private Integer authorid;

    @Field(type = FieldType.Keyword)
    private String author;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String content;

    @Field(type = FieldType.Text)
    private String createtime;

    @TableField(exist = false)
    Integer clicks;

    @TableField(exist = false)
    Integer collections;

    @TableField(exist = false)
    Integer difficult;

    @TableField(exist = false)
    Integer voice;
}
